// Ward, Ezrow, and Dorussen 2011 WP

// Load original dataset
clear
use "WED2011 WP Rep Data.dta"

// REPLICATION
summarize
display c(k)
mdesc
tabmiss
codebook country
codebook year

//Table 1
//Model 1
xtreg position prevposition vposition economic_globalization vpositionXecon_glob, fe robust
mdesc position prevposition vposition economic_globalization vpositionXecon_glob
codebook country
codebook year

//Model 2
xtreg position prevposition economic_globalization, fe robust
mdesc position prevposition economic_globalization
codebook country
codebook year

//Model 3
xtreg position prevposition vposition totaltrade totaltradeXvposition, fe robust
mdesc position prevposition vposition totaltrade totaltradeXvposition
codebook country
codebook year

//Model 4
xtreg position prevposition vposition fdi fdiXvposition, fe robust
mdesc position prevposition vposition fdi fdiXvposition
codebook country
codebook year

//Model 5
xtreg position prevposition vposition quinn_all  quinn_allXvposition,  fe robust
mdesc position prevposition vposition quinn_all  quinn_allXvposition
codebook country
codebook year

// IMPUTATION
clear
use "WED2011 WP Imp Data.dta"
summarize

mi import flong, m(imp) id(party year) imp(diff_pvpos-pecon_glob)

mi xtset party year

//Table 1
//Model 1
mi estimate, post: xtreg position prevposition vposition economic_globalization vpositionXecon_glob, fe robust

//Model 2
mi estimate, post: xtreg position prevposition economic_globalization, fe robust

//Model 3
mi estimate, post: xtreg position prevposition vposition totaltrade totaltradeXvposition, fe robust

//Model 4
mi estimate, post: xtreg position prevposition vposition fdi fdiXvposition, fe robust

//Model 5
mi estimate, post: xtreg position prevposition vposition quinn_all  quinn_allXvposition,  fe robust
